﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Model;
using DAL;
namespace UI
{
    public partial class img3 : System.Web.UI.Page
    {
        public List<ProductInfo> productlist = new List<ProductInfo>();
        public List<ImgTypeInfo> imgtype = new List<ImgTypeInfo>();
        public int count = 0;
        public int pageindex;
        public int pagesize = 11;
        public string keyword = "";
        public string begindate = "";
        public string enddate = "";
        public int typeid = 0;
        public int num = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.Header.Title = "图册";
            pageindex = JobRequest.GetRequestInt("pageindex");
            pageindex = pageindex == 0 ? 1 : pageindex;
            keyword = JobRequest.GetRequestString("keyword");
            typeid = JobRequest.GetRequestInt("typeid");
            imgtype = ImgTypeDAL.FindAll();
            databind();
        }
        public void databind()
        {

            string filter = "";
            if (keyword != "")
            {
                filter += " and name like '%" + keyword + "%'";
            }
            if (typeid != 0)
            {
                filter += " and typeid=" + typeid;
            }
            
            this.Repeater1.DataSource = CommonDAL.Pager("[img]", filter, pagesize, pageindex, ref count);
            this.Repeater1.DataBind();
        }
    }
}